Visitenbuch/src/routes/(app)/entry/[id]/editExecution/+page.svelte

39 lines
1.1 KiB
Svelte

<script lang="ts">
import type { PageData } from "./$types";
import { superForm } from "sveltekit-superforms";
import { superformConfig } from "$lib/shared/util";
import EntryBody from "$lib/components/entry/EntryBody.svelte";
import EntryTodoButton from "$lib/components/ui/EntryTodoButton.svelte";
import MarkdownInput from "$lib/components/ui/markdown/MarkdownInput.svelte";
import { SchemaNewExecution } from "../schema";
export let data: PageData;
const { form, errors, enhance } = superForm(data.form, {
validators: SchemaNewExecution,
...superformConfig("Eintrag"),
});
</script>
<EntryBody backBtn entry={data.entry} />
<form method="POST" use:enhance>
<MarkdownInput
name="text"
ariaInvalid={Boolean($errors.text)}
errors={$errors.text}
label="Ausführungstext bearbeiten"
bind:value={$form.text}
>
<div class="row c-vlight gap-2">
<button class="btn btn-sm btn-primary" type="submit">Speichern</button>
<EntryTodoButton />
</div>
</MarkdownInput>
<input name="old_execution_id" type="hidden" bind:value={$form.old_execution_id} />
</form>